package com.ruoyi.yl.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.domain.Activity;
import com.ruoyi.common.domain.dto.MerchantActivityDTO;
import com.ruoyi.common.domain.query.MerchantActivityQuery;

import java.util.List;

/**
 * <p>
 * 商家活动表，存储商家发布的霸王餐活动信息 服务类
 * </p>
 *
 * @author jiabao
 * @since 2025-06-25
 */
public interface IActivityService extends IService<Activity> {

    List<Activity> selectActivityList(Activity activity);

    Activity selectActivityById(Long id);

    int insertActivity(Activity activity);

    int updateActivity(Activity activity);

    int deleteActivityByIds(Long[] ids);

    /**
     * 微信小程序 首页查询接口
     *
     * @param query 查询参数封装
     * @return
     */
    List<MerchantActivityDTO> getNearbyMerchantActivity(MerchantActivityQuery query);

    /**
     * 预热库存到redis
     *
     */
    void preheatInventory();


    void preheatInventoryByActivity(Activity activity);

    /**
     * 验证活动是否已经开始
     *
     * @param activityId:活动Id
     * @return true: 已经开始 false: 未开始
     */
    boolean verificationActivityHasStart(Long activityId);

    /**
     * 返还库存Redis和数据库
     * @param activityId
     */
    void RefundActivityNumber(Long activityId);
}
